package game.players.actions;

import game.ball.SoccerBall;
import game.players.SoccerPlayer;
import game.players.states.UserWithoutBall;

public class Pass {

	private static final int SPEED = 2;
	
	public static void execute(SoccerPlayer player,SoccerPlayer otherPlayer,SoccerBall ball) {
		player.setState(new UserWithoutBall(player));
		double i = otherPlayer.getX() - player.getX();
		double j = otherPlayer.getY() - player.getY();
		ball.roll(SPEED, i, j);
	}
}
